//
//  ExtesionUILabel.swift
//  YHWeibo
//
//  Created by yuhao.mac on 16/6/28.
//  Copyright © 2016年 yuhao.mac. All rights reserved.
//

import UIKit

extension UILabel {
    convenience init(textColor:UIColor, textFont:CGFloat, maxWidth:CGFloat = 0){
        self.init()
        
        self.textColor = textColor
        self.font = UIFont.systemFontOfSize(textFont)
        
        if maxWidth > 0 {
        
            //设置label的最大宽度
            self.preferredMaxLayoutWidth = maxWidth
            self.numberOfLines = 0
        }
    }
}
